<?php
/*
 * @Author: CHINAKAIYUAN<sunkaiyuan@namenode.cn>
 * @Date: 2022-02-03 00:33:05
 * @LastEditTime: 2022-08-25 21:33:51
 * @LastEditors: CHINAKAIYUAN
 * @Description: 派车单据明细
 */

namespace App\Models;

use Illuminate\Support\Facades\App;
use App\Traits\MaterialTrait;

class ComprehensiveCarryCarDetail extends BaseModel
    {
    use MaterialTrait;
    public $timestamps = true;
    public $table = "sys_comprehensive_carry_car_detail";
    protected $guarded = [];


    public function getSourceAttribute()
        {
        return isEmpty($this->source_model) ? null :
            App::make($this->source_model)->where($this->source_key, "=", $this->source_value)->first();
        }
    }
